<?php
/**
 * Created by PhpStorm.
 * User: peter
 * Date: 2018/6/16
 * Time: 下午2:00
 */

namespace app\mall\controller;

use think\Request;

class Sign extends Base
{

    /**
     * @purpose 获取用户token
     * @param Request $request
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function token (Request $request)
    {
        $code               = $request->get('code', '');
        $token              = $request->get('token', '');
        $invitation         = $request->get('invitation', 'self');
        return \app\mall\logic\Sign::getToken($code, $token, $invitation);
    }
}